{literal}
<h1>Interfaces</h1>




<h2>IDomArProperty</h2>
<pre class="code" >
&lt;?php
/**
* Interfaces that DomArProperties might use to get access to different listening actions.
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property

*/	
interface IDomArProperty {
	
}
?&gt;
</pre>



<h2>Alter table listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyAlterTableListener extends IDomArProperty {
	
	/**
	* @return Boolean true if table was changed
	* This method will be called when creating or updating DomArObject table.
	*/
	public function alterTable( DomArTable $table );

}
?&gt;
</pre>





<h2>Init listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyInitListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object Created object
	* @param Array $value All values from database.
	* This method will be called when loading DomArObject from database.
	* Should return value that will be omitted to object.
	* @return Mixed
	*/
	public function init( DomArObject $object, array &$values );
	
}
?&gt;
</pre>





<h2>Load listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyLoadListener extends IDomArPropertyInitListener {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* This method is will be called when user is tring to access lazy property and its value is not loaded. This method should load the value
	* @return Mixed Loaded value
	*/
	public function load( DomArObject $object, &$propertyValue );
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* Checks if property value is loaded or not
	* @return Boolean
	*/
	public function isLoaded( DomArObject $object, &$propertyValue );
	
}
?&gt;
</pre>

<h2>Compare listener</h2>
<pre class="code" >
&lt;?php
/**
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyCompareListener extends IDomArProperty {
	
	/**
	* @return Boolean true if values are equal, false if not.
	* This method is called before setting and validating property value. If values are same, then no validation or change will occur.
	*/
	public function compare( DomArObject $object, &$oldPropertyValue, &$newPropertyValue );

}
?&gt;
</pre>



<h2>Before set listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyBeforeSetListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $oldPropertyValue
	* @param Mixed $newPropertyValue
	* @return Mixed Changed value
	* This method will be called when object property is updated by user. ($item->value = "new value").
	* Should prepare the value. Value is already validated, so this method should not validate $newPropertyValue
	*/
	public function beforeSet( DomArObject $object, &$oldPropertyValue, &$newPropertyValue );
	
}
?&gt;
</pre>





<h2>After set listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyAfterSetListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* @return Mixed Changed value
	*/
	public function afterSet( DomArObject $object, &$propertyValue );
	
}
?&gt;
</pre>




<h2>Validator</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyValidator extends IDomArProperty  {

	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* @param Array $customParams This can be used to send custom values to error message
	* Valides $propertyValue
	* @return Boolean True if $propertyValue can be omitted to object.
	*/
	public function validate( DomArObject $object, &$propertyValue, array &$customParams = array());
	
}
?&gt;
</pre>


<h2>Before insert listener</h2>
<pre class="code" >
&lt;?php
/**
* This listener will be used before insert query is sent to database.
*  
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyBeforeInsertListener extends IDomArProperty  {

	
	/**
	* Will be invoked before insert query is sent to database. 
	*
	* Should update $fieldNames and $fieldValues 
	* $fieldNames holds mysql column field names. If you add new field always add comma first!
	* $fieldValues holds mysql column field values. If you add new value always add comma first!
	* Data added to these variables will not be checked. So be careful what you omit to them. (For example if addslashes is not used you may create a security problem)
	* These variables will be inserted directly into insert query.
	*
	* @return void
	*/
	public function beforeInsert( DomArSession $session, DomArObject $object, &$propertyValue );
	
}
?&gt;
</pre>


<h2>Insert listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyInsertListener extends IDomArProperty  {

	
	/**
	* @return void
	*/
	public function insert( DomArObject $object, &$propertyValue, DomArValueSet $set  )
}
?&gt;
</pre>



<h2>After insert listener</h2>
<pre class="code" >
&lt;?php
/**
* This listener will be used after insert query is sent to database. Object has id when it is invoked.
*  
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyAfterInsertListener extends IDomArProperty  {

	
	/**
	* @return Array Column names that property will use.
	*/
	public function afterInsert( DomArObject $object, &$propertyValue );
	
	
}
?&gt;
</pre>



<h2>Before update listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyBeforeUpdateListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* @return String
	*/
	public function beforeUpdate( DomArSession $session, DomArObject $object, &$propertyValue );

}
?&gt;
</pre>



<h2>Update listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyUpdateListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* @return String
	*/
	public function update( DomArObject $object, &$propertyValue, DomArValueSet $set );

}
?&gt;
</pre>




<h2>After update listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/
interface IDomArPropertyAfterUpdateListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	*/
	public function afterUpdate( DomArObject $object, &$propertyValue );
	
}
?&gt;
</pre>





<h2>Before delete listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyBeforeDeleteListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* This method will be called when object is beeing deleted.
	*/
	public function beforeDelete( DomArObject $object, &$propertyValue );
	
}
?&gt;
</pre>




<h2>After delete listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyAfterDeleteListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* This method will be called when object is beeing deleted.
	*/
	public function afterDelete( DomArObject $object, &$propertyValue );
	
}
?&gt;
</pre>





<h2>Clone listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertyCloneListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* This method will be called when object is beeing cloned
	*/
	public function _clone( DomArObject $object, &$propertyValue );
	
}
?&gt;
</pre>



<h2>Serialize listener</h2>
<pre class="code" >
&lt;?php
/**
* @author Oliver Leisalu, Inditel Meedia
* @package DomAr
* @subpackage Property
*/	
interface IDomArPropertySerializeListener extends IDomArProperty  {
	
	/**
	* @param DomArObject $object
	* @param Mixed $propertyValue
	* This method will be called when object serialize method is invoked (DO NOT user PHP serialize() function as this will not invoke this! Use $object->serialize())
	*/
	public function serialize( DomArObject $object, $propertyValue );
	
	/**
	* @param Mixed $propertyValue
	* This method will be called when object is unserialized (Use DomArObject::unserialize(String $serialized_domar_object) )
	* @param DomArObject $object
	*/
	public function unserialize( DomArObject $object, $propertyValue );
	
}
?&gt;
</pre>


{/literal}
